<!DOCTYPE html>
<html class="no-js">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
        <link rel="stylesheet" href="css/style.css">
    </head>
    <body>
        <div class="resetpass"></div>
        <div class="reset-form">
            <form method="post" action="" onsubmit="return false" id="form1" autocomplete="off">
                <div class="form-item">
                    <label class="form-label"><span>*</span><span>电子邮箱</span></label>
                    <input class="text-input" type="text" id="Email" name="Email" placeholder="请输入您的常用邮箱地址">
                    <div data-index='0' class="error-mes"></div>
                </div>
                <div class="form-item">
                    <label class="form-label"><span>*</span><p><img onclick="$(this).attr('src', 'http://passport.chuandong.com/vcode.aspx?code=reg'+'&r='+Math.random());" alt="点击换验证码" src="http://passport.chuandong.com/vcode.aspx?code=reg" class="yz" id="validcode" />
                        <a class="change-code" href="javascript:void(0);" onclick="$('#validcode').attr('src', 'http://passport.chuandong.com/vcode.aspx?code=reg&r='+Math.random());" >看不清楚？换张图片</a></p></label>
                    <input data-index='1' class="text-input" type="text" id="checkCode" name="checkCode" placeholder="请输入上图验证码">
                    <div class="error-mes"></div>
                </div>
                <div class="form-item">
                    <input class="" id="RelatedBut1" type="submit" value="发送">
                </div>
            </form>
        </div>
        <script type="text/javascript" src="http://img.chuandong.com/common/script/jquery.js"></script>
        <script type="text/javascript" src="js/common.js"></script>
        <script>
            $('#RelatedBut1').click(function () {
                var Email = $('#Email').val();
                var checkCode = $('#checkCode').val();
                if (Email == "") {
                    $('.error-mes').eq(0).text('请填邮箱')
                    $("#Email").focus();
                    return false;
                } else {
                    $('.error-mes').eq(0).text('')
                }
                if (!/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/.test(Email)) {
                    $('.error-mes').eq(0).text('邮箱地址输入有误!')
                    $('#Email').focus();
                    return false;
                } else {
                    $('.error-mes').eq(0).text('')
                }
                if (checkCode == "") {
                    $('.error-mes').eq(1).text('请再输入验证码')
                    $("#checkCode").focus();
                    return false;
                } else {
                    $('.error-mes').eq(1).text('')
                }
            })
            $('input').live('input propertychange',function () {
                // if () {
                //     $('#RelatedBut1').css({background:'#ff3433',color:'#fff'})
                // }
            })
        </script>
    </body>
</html>